<?php /* Smarty version 2.6.21, created on 2009-07-21 19:27:06
         compiled from section_list.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'section_list.tpl', 51, false),array('function', 'html_options', 'section_list.tpl', 55, false),)), $this); ?>
<table>
  <tr>
    <td id="leftpanel" valign="top">
        <div id="leftpaneldiv">
            <a href="javascript:void(0);" id="hidePanel"><img id="collapse" src="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/collapse.gif" width="15" height="15"></a>
            <div class="header" id="leftPanelHeader">Список страниц</div>
            <div id="leftpaneldata">
                <ul id="sortables">
                <?php unset($this->_sections['menuItem']);
$this->_sections['menuItem']['name'] = 'menuItem';
$this->_sections['menuItem']['loop'] = is_array($_loop=$this->_tpl_vars['Sections']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['menuItem']['show'] = true;
$this->_sections['menuItem']['max'] = $this->_sections['menuItem']['loop'];
$this->_sections['menuItem']['step'] = 1;
$this->_sections['menuItem']['start'] = $this->_sections['menuItem']['step'] > 0 ? 0 : $this->_sections['menuItem']['loop']-1;
if ($this->_sections['menuItem']['show']) {
    $this->_sections['menuItem']['total'] = $this->_sections['menuItem']['loop'];
    if ($this->_sections['menuItem']['total'] == 0)
        $this->_sections['menuItem']['show'] = false;
} else
    $this->_sections['menuItem']['total'] = 0;
if ($this->_sections['menuItem']['show']):

            for ($this->_sections['menuItem']['index'] = $this->_sections['menuItem']['start'], $this->_sections['menuItem']['iteration'] = 1;
                 $this->_sections['menuItem']['iteration'] <= $this->_sections['menuItem']['total'];
                 $this->_sections['menuItem']['index'] += $this->_sections['menuItem']['step'], $this->_sections['menuItem']['iteration']++):
$this->_sections['menuItem']['rownum'] = $this->_sections['menuItem']['iteration'];
$this->_sections['menuItem']['index_prev'] = $this->_sections['menuItem']['index'] - $this->_sections['menuItem']['step'];
$this->_sections['menuItem']['index_next'] = $this->_sections['menuItem']['index'] + $this->_sections['menuItem']['step'];
$this->_sections['menuItem']['first']      = ($this->_sections['menuItem']['iteration'] == 1);
$this->_sections['menuItem']['last']       = ($this->_sections['menuItem']['iteration'] == $this->_sections['menuItem']['total']);
?>
                    <?php if ($this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['parent_id'] && ( $this->_sections['menuItem']['index_prev'] != -1 ) && ( $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index_prev']]['parent_id'] == 0 )): ?>
                        <ul><li id="sortables_<?php echo $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['id']; ?>
">
                    <?php else: ?>
                        <li id="sortables_<?php echo $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['id']; ?>
">
                    <?php endif; ?>
                    <div style="float: right">
        				<A href="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
sections/?id=<?php echo $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['id']; ?>
" onclick="go('<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
sections/?id=<?php echo $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['id']; ?>
'); return false;">
        					<img src="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/edit_icon.png" title="редактировать" width="16" height="16">
        				</a>
        				<a href="javascript: void(0);" onclick="if (confirm('Вы действительно желаете удалить раздел. Все дочерние разделы перенесутся в корень.')) go('<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
sections/delete/?id=<?php echo $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['id']; ?>
'); return false;">
        					<img src="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/delete_icon.png" title="удалить" width="16" height="16">
        				</a>
                    </div>
                    <div class="<?php if ($this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['id'] == $_REQUEST['id']): ?>selected<?php endif; ?>"><?php echo $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['title']; ?>
</div>
                    <div style="clear: both;"></div>
                    <?php if ($this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['parent_id'] == 0 && $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index_next']]['parent_id'] != 0): ?>
                    	
                    <?php else: ?>
                        </li>
                    <?php endif; ?>
                    <?php if ($this->_tpl_vars['Sections'][$this->_sections['menuItem']['index']]['parent_id'] && ( ( ! $this->_sections['menuItem']['last'] && ( $this->_tpl_vars['Sections'][$this->_sections['menuItem']['index_next']]['parent_id'] == 0 ) ) || $this->_sections['menuItem']['last'] )): ?>
                        </li></ul></li>
                    <?php endif; ?>
                <?php endfor; endif; ?>
                </ul>
                <div class="operation">
                    <a href="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
sections/" onclick="go('<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
sections/'); return false;" class="add">добавить</a>
                </div>                
            </div>
        </div>
    </td>
    <td class="spacer">&nbsp;</td>
    <td id="datapanel">
		<div class="form">
		    <H1><?php if ($this->_tpl_vars['Section']->isNew()): ?>Добавление раздела<?php else: ?>Редактирование раздела '<?php echo $this->_tpl_vars['Section']->title; ?>
'<?php endif; ?></H1>
		    <form method="post" action="/backend/sections/save/">
		    <fieldset>
		        <legend>Общая информация</legend>
		        <table class="form">
		        	<tr>
		        		<td style="width: 1px;"><label for="name">Название</label></td>
		        		<td><input type="text" id="title" name="mn[title]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['Section']->title)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"/></td>
		        	</tr> 
		        	<tr>
		        		<td><label for="page_parent_id">Родительский раздел</label></td>
		        		<td><?php echo smarty_function_html_options(array('name' => "mn[parent_id]",'id' => 'parent_id','options' => $this->_tpl_vars['SectionManager']->htmlSelect('title',"Основной раздел"," id <> ?",'IF (parent_id = 0, id*100000, parent_id*100000 + id)','',$this->_tpl_vars['Section']->getPk()),'selected' => $this->_tpl_vars['Section']->parent_id), $this);?>
</td>
		        	</tr>
		        </table>
		    </fieldset> 
		    <div class="buttonpanel">
		        <input type="submit" name="save" value="Сохранить" class="button">
		    </div>
		    <input type="hidden" name="id" id="id" value="<?php echo $this->_tpl_vars['Section']->getPk(); ?>
" />
		    </form>
		</div>
    </td>
  </tr>
</table>
<?php echo '
<script>
    function moveLeftPanel (e) {
        if ($(\'leftpanel\').getDimensions().width > 100) {
            $(\'leftpanel\').morph(\'width: 20px;\');
            $(\'leftPanelHeader\').update("");
            $(\'leftpaneldata\').hide();
            $(\'collapse\').src = \''; ?>
<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/expand.gif<?php echo '\';
        } else {
            $(\'leftpanel\').morph(\'width: 300px;\');
            $(\'collapse\').src = \''; ?>
<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/collapse.gif<?php echo '\';
            setTimeout("$(\'leftPanelHeader\').update(\'Список страниц\')", 1000);
            setTimeout("$(\'leftpaneldata\').show()", 1000);
        }
    }
    
    $(\'hidePanel\').observe(\'click\', moveLeftPanel);
</script>
'; ?>